{% extends "events/base.html" %}
{% load i18n %}

{% block breadcrumbs %}{% if not is_popup %}
<div class="breadcrumbs">
     <a href="../../">Home</a> &rsaquo;
     <a href="../">Event Manager</a> &rsaquo;
     Voting
     
</div>
{% endif %}{% endblock %}

{% block content %}

<h1>Event Metrics</h1>

<table>
	<hr>
		<th align=center>Event Type</th>
		<th align=center>Average Time</th>
		<th align=center>Number of events</th>
		<th align=center>Shortest</th>
		<th align=center>Longest</th>
	</hr>
	{%for stat in stats %}
	<tr>
		<td align=center>{{stat.type}}</td>
		<td align=center>{{stat.average}}</td>
		<td align=center>{{stat.count}}</td>
		<td align=center>{{stat.min.event}} ({{stat.min.value}})</td>
		<td align=center>{{stat.max.event}} ({{stat.max.value}})</td>
	</tr>
	{% endfor %}	
</table>
<br />

<h1>Member Voting Metrics</h1>

<table>
	<hr>
		<th align=center>Member</th>
		<th align=center>Approve</th>
		<th align=center>Reject</th>
		<th align=center>Abstain</th>
		<th align=center>No Vote</th>
		<th align=center>Average Time</th>
		<th align=center>Shortest</th>
		<th align=center>Longest</th>
	</hr>
	{%for member_stat in member_voting_stats %}	
	<tr>
		<td><a href="./user/{{member_stat.member.id}}">{{member_stat.member.first_name}} {{member_stat.member.last_name}}</a></td>
		<td align=center>{{member_stat.approve}}</td>
		<td align=center>{{member_stat.reject}}</td>
		<td align=center>{{member_stat.abstain}}</td>
		<td align=center>{{member_stat.novote}}</td>
		<td align=center>{{member_stat.average}}</td>
		<td align=center>{{member_stat.min.event}} ({{member_stat.min.value}})</td>
		<td align=center>{{member_stat.max.event}} ({{member_stat.max.value}})</td>
	</tr>
	{% endfor %}	
</table>

{% endblock %}
